package com.zhcs.cashbook.util;

import android.view.View;
//防止连续点击类
public abstract class NoDoubleClickListener implements View.OnClickListener {
    public static final int DELAY_TIME = 1500;
    private long lastClickTime = 0;

    protected abstract void OnNoDoubleClick(View view);

    @Override
    public void onClick(View v) {
        long currentTime = System.currentTimeMillis();
        if (currentTime - lastClickTime > DELAY_TIME) {
            lastClickTime = currentTime;
            OnNoDoubleClick(v);
        }
    }
}
